/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package cz.bsa.soft.i18nparser.core;

/**
 *
 * @author vdusa
 */
public class I18nProperty {
    public String code;
    public String defaultValue;

    public I18nProperty(String code, String defaultValue) {
        this.code = code;
        this.defaultValue = defaultValue;
    }

    @Override
    public boolean equals(Object aThat) {
        if (!(aThat instanceof I18nProperty)) {
            return false;
        }

        I18nProperty property = (I18nProperty) aThat;

        if (property.code != null) {
            if (property.code.equals(code)) {
                return true;
            } else {
                return false;
            }
        } else {
            if (code == null) {
                return true;
            } else {
                return false;
            }
        }
    }

    @Override
    public int hashCode() {
        if (code == null) {
            return 0;
        } else {
            return code.hashCode();
        }
    }
}
